<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:76:"/Users/ztos/workspace/shyp/public/../application/admin/view/auth/access.html";i:1502695296;s:76:"/Users/ztos/workspace/shyp/public/../application/admin/view/base/common.html";i:1510708173;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo \think\Config::get('web_site_title'); ?> | 超级后台</title>
    <!-- CSS Files -->
    <link href="/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/admin/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <style type="text/css">
        .profile-element { text-align: center; }
        .img-circle {  width:48px; }
        .label small{
            font-size: 12px !important;
        }
    </style>

    <!-- iCheck -->
    <link href="/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <!-- Toastr style -->
    <link href="/admin/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <!-- CSS Files -->
    <link href="/admin/css/animate.css" rel="stylesheet">
    <link href="/admin/css/style.css" rel="stylesheet">
    <link href="/admin/css/main.css" rel="stylesheet">
    <script src="/static/js/jquery-3.1.1.min.js"></script>
    <script src="/static/js/jquery-migrate-3.0.0.min.js"></script>
    
<style type="text/css">
    .checkmod dt{
        border-bottom-color: #ebebeb;
        background-color: #ECECEC;
    }
    .form-horizontal .checkbox {
        min-height: 35px;
        margin-left: 20px;
    }
    .checkbox input[type=checkbox] {
        position: absolute;
        margin-top: 4px\9;
        margin-left: -15px;
    }
    .hd{height: 35px}
    .dd_title{height: 35px}
    .divsion{padding-left: 30px}
    .check_text{margin-left: 8px}
</style>

</head>
<body>
<div id="wrapper">
    <!-- 左侧系统菜单栏 -->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <div class="nav-header">
                    <div class="dropdown profile-element">
                        <span><?php if($user_auth['header'] == ''): ?><img alt="image" class="img-circle" src="/admin/images/profile_small.jpg" /><?php else: ?><img alt="image" style="width: 48px;height: 48px;" class="img-circle" src="<?php echo $user_auth['header']; ?>" /><?php endif; ?></span>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold"><?php echo $user_auth['username']; ?></strong></span>
                            <span class="text-muted text-xs block"><?php echo $user_auth['group_name']; ?><b class="caret"></b></span> </span> </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="<?php echo Url('User/profile'); ?>">个人信息</a></li>
                            <li><a href="<?php echo Url('Message/index'); ?>">消息中心</a></li>
                            <li class="divider"></li>
                            <li><a href="<?php echo Url('Base/logout'); ?>">退出</a></li>
                        </ul>
                    </div>
                    <div class="logo-element">VAN+</div>
                </div>
                <?php if(is_array($__MENU__) || $__MENU__ instanceof \think\Collection || $__MENU__ instanceof \think\Paginator): $i = 0; $__LIST__ = $__MENU__;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;if(empty($menu['child']) || (($menu['child'] instanceof \think\Collection || $menu['child'] instanceof \think\Paginator ) && $menu['child']->isEmpty())): if($menu['id'] == $subMenu['id']): ?><li class="active"><?php else: ?><li><?php endif; ?>
                <a href="<?php echo Url($menu['url']); ?>"><i class="fa <?php echo $menu['icon']; ?>"></i><span class="nav-label"><?php echo $menu['title']; ?></span></a></li>
                <?php else: if($subMenu['pid'] == $menu['id']): ?><li class="active"><?php else: ?><li><?php endif; ?>
                <a href="<?php echo Url($menu['url']); ?>"><i class="fa <?php echo $menu['icon']; ?>"></i> <span class="nav-label"><?php echo $menu['title']; ?></span>
                    <?php if($menu['url'] == 'admin/Message/index'): ?>
                    <span class="label label-warning pull-right"><?php echo $messageTotal; ?></span>
                    <?php else: ?>
                    <span class="fa arrow"></span>
                    <?php endif; ?>
                </a>
                <ul class="nav nav-second-level collapse <?php if($subMenu['pid'] == $menu['id']): ?>in<?php endif; ?>">
                    <?php if(is_array($menu['child']) || $menu['child'] instanceof \think\Collection || $menu['child'] instanceof \think\Paginator): $i = 0; $__LIST__ = $menu['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$child): $mod = ($i % 2 );++$i;if($subMenu['id'] == $child['id']): ?><li class="active"><?php else: ?><li><?php endif; ?>
                    <a href="<?php echo Url($child['url']); ?>"><?php echo $child['title']; ?></a></li>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </ul></li>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </nav>
    <!-- 右侧主体内容 -->
    <div id="page-wrapper" class="gray-bg">
        <!-- 中间头部 -->
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top white-bg" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                    <form role="search" class="navbar-form-custom" action="<?php echo Url('Index/search'); ?>">
                        <div class="form-group">
                            <input type="text" placeholder="搜索内容" class="form-control" name="top-search" id="top-search">
                        </div>
                    </form>
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <li>
                        <span class="m-r-sm text-muted welcome-message">欢迎使用<?php echo \think\Config::get('web_site_title'); ?></span>
                    </li>
                    <li class="dropdown">
                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                            <i class="fa fa-envelope"></i><span class="label label-warning"><?php echo $messageTotal; ?></span>
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo Url('Base/logout'); ?>"><i class="fa fa-sign-out"></i> 退出</a>
                    </li>
                    <li>
                        <a class="right-sidebar-toggle"><i class="fa fa-tasks"></i></a>
                    </li>
                </ul>
            </nav>
        </div>
        <!-- 页面路径 -->
        
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>访问授权</h2>
        <ol class="breadcrumb">
            <li><a href="<?php echo Url('Auth/index'); ?>">Index</a></li>
            <li class="active"><strong>access</strong></li>
        </ol>
    </div>
    <div class="col-lg-2"></div>
</div>

        <!-- 中间主体内容 -->
        
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>授权列表</h5>
                    <div class="ibox-tools">
                        <a href="javascript:window.history.go(-1);" class="btn btn-white btn-xs" data-toggle="tooltip" data-placement="top" title="" data-original-title="返回"><i class="fa fa-reply"></i> 返回</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="tab-pane in">
                        <form action="<?php echo Url('Auth/writeGroup'); ?>" enctype="application/x-www-form-urlencoded" method="POST" class="form-horizontal auth-form">
                            <?php if(is_array($node_list) || $node_list instanceof \think\Collection || $node_list instanceof \think\Paginator): $i = 0; $__LIST__ = $node_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$node): $mod = ($i % 2 );++$i;?>
                            <dl class="checkmod">
                                <dt class="hd">
                                    <label class="checkbox check-all"><input class="auth_rules rules_all i-checks check" type="checkbox" name="rules[]" value="<?php echo $main_rules[$node['url']] ?>"><span class="check_text"><?php echo $node['title']; ?>管理</span></label>
                                </dt>
                                <dd class="bd">
                                    <?php if(isset($node['child'])): if(is_array($node['child']) || $node['child'] instanceof \think\Collection || $node['child'] instanceof \think\Paginator): $i = 0; $__LIST__ = $node['child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$child): $mod = ($i % 2 );++$i;?>
                                    <div class="rule_check">
                                        <div class="dd_title">
                                            <label class="checkbox check_child" <?php if(!(empty($child['tip']) || (($child['tip'] instanceof \think\Collection || $child['tip'] instanceof \think\Paginator ) && $child['tip']->isEmpty()))): ?> title='<?php echo $child['tip']; ?>'<?php endif; ?>>
                                            <input class="auth_rules rules_row i-checks ids" type="checkbox" name="rules[]" value="<?php echo $auth_rules[$child['url']] ?>"/><span class="check_text"><?php echo $child['title']; ?></span>
                                            </label>
                                        </div>
                                        <?php if(!(empty($child['operator']) || (($child['operator'] instanceof \think\Collection || $child['operator'] instanceof \think\Paginator ) && $child['operator']->isEmpty()))): ?>
                                        <span class="divsion">&nbsp;</span>
                                        <span class="child_row">
                                            <?php if(is_array($child['operator']) || $child['operator'] instanceof \think\Collection || $child['operator'] instanceof \think\Paginator): $i = 0; $__LIST__ = $child['operator'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$op): $mod = ($i % 2 );++$i;?>
                                                <label class="checkbox" <?php if(!(empty($op['tip']) || (($op['tip'] instanceof \think\Collection || $op['tip'] instanceof \think\Paginator ) && $op['tip']->isEmpty()))): ?> title='<?php echo $op['tip']; ?>'<?php endif; ?>>
                                                <input class="auth_rules i-checks ids idds" type="checkbox" name="rules[]" value="<?php echo $auth_rules[$op['url']] ?>"/><span class="check_text"><?php echo $op['title']; ?></span>
                                            </label>
                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                            </span>
                                        <?php endif; ?>
                                    </div>
                                    <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                </dd>
                            </dl>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                            <div class="hr-line-dashed"></div>
                            <input type="hidden" name="id" value="<?php echo $this_group['id']; ?>" />
                            <button class="btn btn-return btn-white" onclick="javascript:history.back(-1);return false;">返 回</button>
                            <button type="submit" class="btn submit-btn ajax-post btn-primary" target-form="auth-form">确 定</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

        <!-- 底部信息 -->
        <div class="footer">
            <div class="pull-right">版本 <strong><?php echo \think\Config::get('web_version'); ?></strong></div>
            <div><strong>Copyright</strong> <?php echo \think\Config::get('web_company_name'); ?> &copy; 2016-2017</div>
        </div>
    </div>
    <!-- 右侧工具栏 -->
</div>
<!-- Mainly scripts -->
<script src="/admin/js/bootstrap.min.js"></script>
<script src="/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="/admin/js/inspinia.js"></script>
<script src="/admin/js/plugins/pace/pace.min.js"></script>
<script src="/admin/js/common.js"></script>
<!-- Toastr script -->
<script src="/admin/js/plugins/toastr/toastr.min.js"></script>
<script src="/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="/admin/js/plugins/sweetalert/sweetalert.min.js"></script>


<script type="text/javascript" src="/static/qtip/jquery.qtip.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/qtip/jquery.qtip.min.css" media="all">
<script type="text/javascript" charset="utf-8">
    +function($){
        var rules = [<?php echo $this_group['rules']; ?>];
        $('.auth_rules').each(function(){
            if( $.inArray( parseInt(this.value,10),rules )>-1 ){
                $(this).prop('checked',true);
            }
            if(this.value==''){
                $(this).closest('span').remove();
            }
        });

        //全选节点
        $(".check-all").on("ifChanged",function(){
            $(this).closest('dl').find('dd').find('input').iCheck("toggle")
            $(this).closest('dl').find('dd').find('.idds').iCheck("toggle")
        });
        $(".check_child").on("ifChanged",function(){
            $(this).closest('.rule_check').find('.child_row').find('input').iCheck("toggle")
        });


        $('.rules_all').on('change',function(){
            $(this).closest('dl').find('dd').find('input').attr('checked',this.checked);
//        $(this).closest('dl').find('dd').find('input').prop('checked',this.checked);
        });
        $('.rules_row').on('change',function(){
            $(this).closest('.rule_check').find('.child_row').find('input').prop('checked',this.checked);
        });

        $('.checkbox').each(function(){
            $(this).qtip({
                content: {
                    text: $(this).attr('title'),
                    title: $(this).text()
                },
                position: {
                    my: 'bottom center',
                    at: 'top center',
                    target: $(this)
                },
                style: {
                    classes: 'qtip-dark',
                    tip: {
                        corner: true,
                        mimic: false,
                        width: 10,
                        height: 10
                    }
                }
            });
        });

        $('select[name=group]').change(function(){
            location.href = this.value;
        });

        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
    }(jQuery);
</script>

</body>
</html>
